fix: add network policies and scope Vault permissions per service#425
Open
fix: add network policies and scope Vault permissions per service#425
Conversation
Network policies: - Default-deny ingress for 5stack namespace - Allow ingress controller to reach web, api, hasura, minio, typesense - TimescaleDB: only reachable from hasura and api - Redis: only reachable from api and connector - Hasura: only from api, web, and ingress - API: only from ingress and connector - Connector: only from api Vault: - Replace wildcard path "*" with explicit per-service read-only paths matching the kv/data/* paths used by migrate_secrets_to_vault - External-secrets can only read specific service secrets, not create/update/delete or access arbitrary vault paths Closes #413
Game server pods (labeled app: game-server) need WebSocket access to the API for match event communication. Without this, match events would be blocked by the default-deny policy.
Per code review — 4 critical/important missing policies: - Hasura → API: needed for auth/event/action webhooks - Backup CronJob → TimescaleDB + MinIO: needed for pg_dump + S3 upload - API → MinIO: needed for S3 operations (demos, assets) - API → Typesense: needed for player search indexing Also adds app: postgres-backup label to backup CronJob pod template so it can be selected by network policies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Network Policies — Implements network segmentation for the 5stack namespace:
default-deny-ingressallow-ingress-to-servicesallow-timescaledb-ingressallow-redis-ingressallow-hasura-ingressallow-api-ingressallow-connector-ingressVault Policy — Replaced wildcard
path "*"with explicit per-service read-only paths:kv/data/api,kv/data/redis, etc.) getsread, listonlycreate, update, deletecapabilities from external-secrets rolemigrate_secrets_to_vaultin setup-env.shTest plan
kubectl kustomize basebuilds successfully (7 NetworkPolicies generated)Closes #413